#include "sound.h"

void Sound::setPanning(int right)
{
	effect=PANNING;
	if(right>127)
		right=127;
	else if(right<-127)
		right=-127;
	panning=right;
}

void Sound::setDistance(int dis)
{
	effect=DISTANCE;
	if(dis<0)
		dis=0;
	else if(dis>255)
		dis=255;
	distance=dis;
}

void Sound::setPosition(int dis,int angle)
{
	effect=POSITION;
	if(dis<0)
		dis=0;
	else if(dis>255)
		dis=255;
	//Angle is in degrees
	angle%=360;
	distance=dis;
	position=angle;
}
